# encoding=utf-8_general_ci

import tornado.web
import sae.const
import tornado.database
import os.path

db =tornado.database.Connection(sae.const.MYSQL_HOST+":"+sae.const.MYSQL_PORT,sae.const.MYSQL_DB, sae.const.MYSQL_USER, sae.const.MYSQL_PASS, 30)

from article import article
from comment import comment
from main import MainHandler
from article_handler import ArticleHandler
from comment_handler import CommentHandler
from connection import Connection
from praise_handler import PraiseHandler
from admin import AdminHandler

settings = {
    "debug": False,
    "template_path": os.path.join(os.path.dirname(__file__), "template"),
    "static_path" : os.path.join(os.path.dirname(__file__), "static"),
    }

application = tornado.web.Application([
        (r"/", MainHandler),
        (r"/comments", CommentHandler),
        (r"/publish",  ArticleHandler),
        (r"/praise", PraiseHandler),
        (r"/admin", AdminHandler),
        ], **settings)

